// 2025/09/07
// Author: Forever
#include <bits/stdc++.h>
using namespace std;

int n, m, dp[100001], a[100001], b[100001], ans[100001], f[100001];

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> m >> n;
    for (int i = 1; i <= m; i++)
        cin >> a[i] >> b[i];

    for (int i = 0; i <= n; i++)
        dp[i] = -1e9;
    dp[0] = 0;

    for (int i = 1; i <= m; i++)
        for (int j = a[i]; j <= n; j++) {
            if (dp[j - a[i]] != -1e9)
                dp[j] = max(dp[j], dp[j - a[i]] + b[i]);
        }

    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= i; j++)
            if (dp[j] != -1e9)
                f[i] = max(f[i], dp[j] + f[i - j + dp[j]]);
        if (f[i] + i >= n)
            break;
    }

    int last = 0;
    for (int s = 0; s <= n; s++) {
        int reach = s + f[s];
        if (reach > n)
            reach = n;
        for (int i = last + 1; i <= reach; i++)
            ans[i] = s;
        last = max(last, reach);
        if (last == n)
            break;
    }

    for (int i = 1; i <= n; i++)
        cout << ans[i] << endl;
    return 0;
}